{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from kubernetes.client import V1ObjectMeta\n",
    "import kubeflow.katib as kc\n",
    "from kubeflow.katib import constants\n",
    "from kubeflow.katib import utils\n",
    "from kubeflow.katib import V1alpha3AlgorithmSetting\n",
    "from kubeflow.katib import V1alpha3AlgorithmSetting\n",
    "from kubeflow.katib import V1alpha3AlgorithmSpec\n",
    "from kubeflow.katib import V1alpha3CollectorSpec\n",
    "from kubeflow.katib import V1alpha3EarlyStoppingSetting\n",
    "from kubeflow.katib import V1alpha3EarlyStoppingSpec\n",
    "from kubeflow.katib import V1alpha3Experiment\n",
    "from kubeflow.katib import V1alpha3ExperimentCondition\n",
    "from kubeflow.katib import V1alpha3ExperimentList\n",
    "from kubeflow.katib import V1alpha3ExperimentSpec\n",
    "from kubeflow.katib import V1alpha3ExperimentStatus\n",
    "from kubeflow.katib import V1alpha3FeasibleSpace\n",
    "from kubeflow.katib import V1alpha3FileSystemPath\n",
    "from kubeflow.katib import V1alpha3FilterSpec\n",
    "from kubeflow.katib import V1alpha3GoTemplate\n",
    "from kubeflow.katib import V1alpha3GraphConfig\n",
    "from kubeflow.katib import V1alpha3Metric\n",
    "from kubeflow.katib import V1alpha3MetricsCollectorSpec\n",
    "from kubeflow.katib import V1alpha3NasConfig\n",
    "from kubeflow.katib import V1alpha3ObjectiveSpec\n",
    "from kubeflow.katib import V1alpha3Observation\n",
    "from kubeflow.katib import V1alpha3Operation\n",
    "from kubeflow.katib import V1alpha3OptimalTrial\n",
    "from kubeflow.katib import V1alpha3ParameterAssignment\n",
    "from kubeflow.katib import V1alpha3ParameterSpec\n",
    "from kubeflow.katib import V1alpha3SourceSpec\n",
    "from kubeflow.katib import V1alpha3Suggestion\n",
    "from kubeflow.katib import V1alpha3SuggestionCondition\n",
    "from kubeflow.katib import V1alpha3SuggestionList\n",
    "from kubeflow.katib import V1alpha3SuggestionSpec\n",
    "from kubeflow.katib import V1alpha3SuggestionStatus\n",
    "from kubeflow.katib import V1alpha3TemplateSpec\n",
    "from kubeflow.katib import V1alpha3Trial\n",
    "from kubeflow.katib import V1alpha3TrialAssignment\n",
    "from kubeflow.katib import V1alpha3TrialCondition\n",
    "from kubeflow.katib import V1alpha3TrialList\n",
    "from kubeflow.katib import V1alpha3TrialSpec\n",
    "from kubeflow.katib import V1alpha3TrialStatus\n",
    "from kubeflow.katib import V1alpha3TrialTemplate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "algorithmsettings = V1alpha3AlgorithmSetting(\n",
    "    name= None,\n",
    "    value = None\n",
    ")\n",
    "\n",
    "algorithm = V1alpha3AlgorithmSpec(\n",
    "    algorithm_name = \"tpe\",\n",
    "    algorithm_settings = [algorithmsettings]\n",
    ")\n",
    "\n",
    "# Metric Collector\n",
    "collector = V1alpha3CollectorSpec(kind = \"StdOut\")\n",
    "metrics_collector_spec = V1alpha3MetricsCollectorSpec(\n",
    "    collector = collector\n",
    ")\n",
    "\n",
    "# Objective\n",
    "objective = V1alpha3ObjectiveSpec(\n",
    "    goal = 1.8,\n",
    "    objective_metric_name = \"loss\",\n",
    "    type = \"minimize\"\n",
    ")\n",
    "\n",
    "# Parameters\n",
    "feasible_space = V1alpha3FeasibleSpace(min = \"1\", max = \"3\")\n",
    "epochs_parameter_spec = V1alpha3ParameterSpec(\n",
    "    feasible_space = feasible_space, \n",
    "    name = \"--epochs\",\n",
    "    parameter_type = \"int\"\n",
    ")\n",
    "\n",
    "feasible_space = V1alpha3FeasibleSpace(min = \"0.0001\", max = \"0.01\")\n",
    "lr_parameter_spec = V1alpha3ParameterSpec(\n",
    "    feasible_space = feasible_space, \n",
    "    name = \"--learning_rate\",\n",
    "    parameter_type = \"double\"\n",
    ")\n",
    "\n",
    "parameters = [epochs_parameter_spec, lr_parameter_spec]\n",
    "\n",
    "# Trialtemplate\n",
    "go_template = V1alpha3GoTemplate(\n",
    "    raw_template =   \"apiVersion: \\\"kubeflow.org/v1\\\"\\nkind: TFJob\\nmetadata:\\n  name: {{.Trial}}\\n  namespace: {{.NameSpace}}\\nspec:\\n tfReplicaSpecs:\\n  Worker:\\n    replicas: 1\\n    restartPolicy: OnFailure\\n    template:\\n      spec:\\n        containers:\\n          - name: tensorflow\\n            image: gcr.io/gsoc-kf-example/distributed_tf_2_neural_machine_translation:1.0\\n            imagePullPolicy: Always\\n            command:\\n              - \\\"python3\\\"\\n              - \\\"/app/text_classification_rnn.py\\\"\\n              {{- with .HyperParameters}}\\n              {{- range .}}\\n              - \\\"{{.Name}}={{.Value}}\\\"\\n              {{- end}}\\n              {{- end}}\"\n",
    ")\n",
    "\n",
    "\n",
    "trial_template= V1alpha3TrialTemplate(go_template=go_template)\n",
    "\n",
    "\n",
    "# Experiment\n",
    "experiment = V1alpha3Experiment(\n",
    "    api_version=\"kubeflow.org/v1alpha3\",\n",
    "    kind=\"Experiment\",\n",
    "    metadata=V1ObjectMeta(name=\"neural-machine-translation\",namespace=\"kubeflow-mailsforyashj\"),\n",
    "\n",
    "    spec=V1alpha3ExperimentSpec(\n",
    "         algorithm = algorithm,\n",
    "         max_failed_trial_count=3,\n",
    "         max_trial_count=12,\n",
    "         metrics_collector_spec= metrics_collector_spec ,\n",
    "         objective = objective,\n",
    "         parallel_trial_count=4,\n",
    "         parameters = parameters ,\n",
    "         trial_template = trial_template\n",
    "    )\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "namespace = kc.utils.get_default_target_namespace()\n",
    "kclient = kc.KatibClient()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Create Experiment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "Katib Experiment link <a href=\"/_/katib/#/katib/hp_monitor/kubeflow-mailsforyashj/neural-machine-translation\" target=\"_blank\">here</a>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "{'apiVersion': 'kubeflow.org/v1alpha3',\n",
       " 'kind': 'Experiment',\n",
       " 'metadata': {'creationTimestamp': '2020-07-26T17:22:44Z',\n",
       "  'generation': 1,\n",
       "  'name': 'neural-machine-translation',\n",
       "  'namespace': 'kubeflow-mailsforyashj',\n",
       "  'resourceVersion': '44990642',\n",
       "  'selfLink': '/apis/kubeflow.org/v1alpha3/namespaces/kubeflow-mailsforyashj/experiments/neural-machine-translation',\n",
       "  'uid': '9e02934b-cf64-11ea-89e4-42010a8c0018'},\n",
       " 'spec': {'algorithm': {'algorithmName': 'tpe', 'algorithmSettings': [{}]},\n",
       "  'maxFailedTrialCount': 3,\n",
       "  'maxTrialCount': 12,\n",
       "  'metricsCollectorSpec': {'collector': {'kind': 'StdOut'}},\n",
       "  'objective': {'goal': 1.8,\n",
       "   'objectiveMetricName': 'loss',\n",
       "   'type': 'minimize'},\n",
       "  'parallelTrialCount': 4,\n",
       "  'parameters': [{'feasibleSpace': {'max': '3', 'min': '1'},\n",
       "    'name': '--epochs',\n",
       "    'parameterType': 'int'},\n",
       "   {'feasibleSpace': {'max': '0.01', 'min': '0.0001'},\n",
       "    'name': '--learning_rate',\n",
       "    'parameterType': 'double'}],\n",
       "  'trialTemplate': {'goTemplate': {'rawTemplate': 'apiVersion: \"kubeflow.org/v1\"\\nkind: TFJob\\nmetadata:\\n  name: {{.Trial}}\\n  namespace: {{.NameSpace}}\\nspec:\\n tfReplicaSpecs:\\n  Worker:\\n    replicas: 1\\n    restartPolicy: OnFailure\\n    template:\\n      spec:\\n        containers:\\n          - name: tensorflow\\n            image: gcr.io/gsoc-kf-example/tf_2_text_classification:1.4\\n            imagePullPolicy: Always\\n            command:\\n              - \"python3\"\\n              - \"/app/text_classification_rnn.py\"\\n              {{- with .HyperParameters}}\\n              {{- range .}}\\n              - \"{{.Name}}={{.Value}}\"\\n              {{- end}}\\n              {{- end}}'}}}}"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.create_experiment(experiment,namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get Single Experiment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'apiVersion': 'kubeflow.org/v1alpha3',\n",
       " 'kind': 'Experiment',\n",
       " 'metadata': {'creationTimestamp': '2020-07-26T17:22:44Z',\n",
       "  'finalizers': ['update-prometheus-metrics'],\n",
       "  'generation': 1,\n",
       "  'name': 'neural-machine-translation',\n",
       "  'namespace': 'kubeflow-mailsforyashj',\n",
       "  'resourceVersion': '44990644',\n",
       "  'selfLink': '/apis/kubeflow.org/v1alpha3/namespaces/kubeflow-mailsforyashj/experiments/neural-machine-translation',\n",
       "  'uid': '9e02934b-cf64-11ea-89e4-42010a8c0018'},\n",
       " 'spec': {'algorithm': {'algorithmName': 'tpe', 'algorithmSettings': [{}]},\n",
       "  'maxFailedTrialCount': 3,\n",
       "  'maxTrialCount': 12,\n",
       "  'metricsCollectorSpec': {'collector': {'kind': 'StdOut'}},\n",
       "  'objective': {'goal': 1.8,\n",
       "   'objectiveMetricName': 'loss',\n",
       "   'type': 'minimize'},\n",
       "  'parallelTrialCount': 4,\n",
       "  'parameters': [{'feasibleSpace': {'max': '3', 'min': '1'},\n",
       "    'name': '--epochs',\n",
       "    'parameterType': 'int'},\n",
       "   {'feasibleSpace': {'max': '0.01', 'min': '0.0001'},\n",
       "    'name': '--learning_rate',\n",
       "    'parameterType': 'double'}],\n",
       "  'trialTemplate': {'goTemplate': {'rawTemplate': 'apiVersion: \"kubeflow.org/v1\"\\nkind: TFJob\\nmetadata:\\n  name: {{.Trial}}\\n  namespace: {{.NameSpace}}\\nspec:\\n tfReplicaSpecs:\\n  Worker:\\n    replicas: 1\\n    restartPolicy: OnFailure\\n    template:\\n      spec:\\n        containers:\\n          - name: tensorflow\\n            image: gcr.io/gsoc-kf-example/tf_2_text_classification:1.4\\n            imagePullPolicy: Always\\n            command:\\n              - \"python3\"\\n              - \"/app/text_classification_rnn.py\"\\n              {{- with .HyperParameters}}\\n              {{- range .}}\\n              - \"{{.Name}}={{.Value}}\"\\n              {{- end}}\\n              {{- end}}'}}},\n",
       " 'status': {'completionTime': None,\n",
       "  'conditions': [{'lastTransitionTime': '2020-07-26T17:22:44Z',\n",
       "    'lastUpdateTime': '2020-07-26T17:22:44Z',\n",
       "    'message': 'Experiment is created',\n",
       "    'reason': 'ExperimentCreated',\n",
       "    'status': 'True',\n",
       "    'type': 'Created'}],\n",
       "  'currentOptimalTrial': {'bestTrialName': '',\n",
       "   'observation': {'metrics': None},\n",
       "   'parameterAssignments': None},\n",
       "  'startTime': '2020-07-26T17:22:44Z'}}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.get_experiment(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get All Experiments "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'apiVersion': 'kubeflow.org/v1alpha3',\n",
       " 'items': [{'apiVersion': 'kubeflow.org/v1alpha3',\n",
       "   'kind': 'Experiment',\n",
       "   'metadata': {'creationTimestamp': '2020-07-26T17:22:44Z',\n",
       "    'finalizers': ['update-prometheus-metrics'],\n",
       "    'generation': 1,\n",
       "    'name': 'neural-machine-translation',\n",
       "    'namespace': 'kubeflow-mailsforyashj',\n",
       "    'resourceVersion': '44990644',\n",
       "    'selfLink': '/apis/kubeflow.org/v1alpha3/namespaces/kubeflow-mailsforyashj/experiments/neural-machine-translation',\n",
       "    'uid': '9e02934b-cf64-11ea-89e4-42010a8c0018'},\n",
       "   'spec': {'algorithm': {'algorithmName': 'tpe', 'algorithmSettings': [{}]},\n",
       "    'maxFailedTrialCount': 3,\n",
       "    'maxTrialCount': 12,\n",
       "    'metricsCollectorSpec': {'collector': {'kind': 'StdOut'}},\n",
       "    'objective': {'goal': 1.8,\n",
       "     'objectiveMetricName': 'loss',\n",
       "     'type': 'minimize'},\n",
       "    'parallelTrialCount': 4,\n",
       "    'parameters': [{'feasibleSpace': {'max': '3', 'min': '1'},\n",
       "      'name': '--epochs',\n",
       "      'parameterType': 'int'},\n",
       "     {'feasibleSpace': {'max': '0.01', 'min': '0.0001'},\n",
       "      'name': '--learning_rate',\n",
       "      'parameterType': 'double'}],\n",
       "    'trialTemplate': {'goTemplate': {'rawTemplate': 'apiVersion: \"kubeflow.org/v1\"\\nkind: TFJob\\nmetadata:\\n  name: {{.Trial}}\\n  namespace: {{.NameSpace}}\\nspec:\\n tfReplicaSpecs:\\n  Worker:\\n    replicas: 1\\n    restartPolicy: OnFailure\\n    template:\\n      spec:\\n        containers:\\n          - name: tensorflow\\n            image: gcr.io/gsoc-kf-example/tf_2_text_classification:1.4\\n            imagePullPolicy: Always\\n            command:\\n              - \"python3\"\\n              - \"/app/text_classification_rnn.py\"\\n              {{- with .HyperParameters}}\\n              {{- range .}}\\n              - \"{{.Name}}={{.Value}}\"\\n              {{- end}}\\n              {{- end}}'}}},\n",
       "   'status': {'completionTime': None,\n",
       "    'conditions': [{'lastTransitionTime': '2020-07-26T17:22:44Z',\n",
       "      'lastUpdateTime': '2020-07-26T17:22:44Z',\n",
       "      'message': 'Experiment is created',\n",
       "      'reason': 'ExperimentCreated',\n",
       "      'status': 'True',\n",
       "      'type': 'Created'}],\n",
       "    'currentOptimalTrial': {'bestTrialName': '',\n",
       "     'observation': {'metrics': None},\n",
       "     'parameterAssignments': None},\n",
       "    'startTime': '2020-07-26T17:22:44Z'}}],\n",
       " 'kind': 'ExperimentList',\n",
       " 'metadata': {'continue': '',\n",
       "  'resourceVersion': '44990809',\n",
       "  'selfLink': '/apis/kubeflow.org/v1alpha3/namespaces/kubeflow-mailsforyashj/experiments'}}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.get_experiment(namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get Experiment Status"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Running'"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.get_experiment_status(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Is Experiment Succeded"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.is_experiment_succeeded(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### List Trials of an Experiment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'name': 'neural-machine-translation-8pb8z7fc', 'status': 'Succeeded'},\n",
       " {'name': 'neural-machine-translation-dqb64l9j', 'status': 'Succeeded'},\n",
       " {'name': 'neural-machine-translation-flkvp4nl', 'status': 'Succeeded'},\n",
       " {'name': 'neural-machine-translation-rj46w9wn', 'status': 'Succeeded'}]"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.list_trials(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### List All Experiments"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[{'name': 'neural-machine-translation', 'status': 'Running'}]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.list_experiments(namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Get Optimal Hyperparameter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'currentOptimalTrial': {'bestTrialName': '',\n",
       "  'observation': {'metrics': None},\n",
       "  'parameterAssignments': None}}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.get_optimal_hyperparmeters(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Delete Experiment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'apiVersion': 'kubeflow.org/v1alpha3',\n",
       " 'kind': 'Experiment',\n",
       " 'metadata': {'creationTimestamp': '2020-07-26T17:22:44Z',\n",
       "  'deletionGracePeriodSeconds': 0,\n",
       "  'deletionTimestamp': '2020-07-29T14:32:24Z',\n",
       "  'finalizers': ['update-prometheus-metrics'],\n",
       "  'generation': 2,\n",
       "  'name': 'neural-machine-translation',\n",
       "  'namespace': 'kubeflow-mailsforyashj',\n",
       "  'resourceVersion': '47721653',\n",
       "  'selfLink': '/apis/kubeflow.org/v1alpha3/namespaces/kubeflow-mailsforyashj/experiments/neural-machine-translation',\n",
       "  'uid': '9e02934b-cf64-11ea-89e4-42010a8c0018'},\n",
       " 'spec': {'algorithm': {'algorithmName': 'tpe', 'algorithmSettings': [{}]},\n",
       "  'maxFailedTrialCount': 3,\n",
       "  'maxTrialCount': 12,\n",
       "  'metricsCollectorSpec': {'collector': {'kind': 'StdOut'}},\n",
       "  'objective': {'goal': 1.8,\n",
       "   'objectiveMetricName': 'loss',\n",
       "   'type': 'minimize'},\n",
       "  'parallelTrialCount': 4,\n",
       "  'parameters': [{'feasibleSpace': {'max': '3', 'min': '1'},\n",
       "    'name': '--epochs',\n",
       "    'parameterType': 'int'},\n",
       "   {'feasibleSpace': {'max': '0.01', 'min': '0.0001'},\n",
       "    'name': '--learning_rate',\n",
       "    'parameterType': 'double'}],\n",
       "  'trialTemplate': {'goTemplate': {'rawTemplate': 'apiVersion: \"kubeflow.org/v1\"\\nkind: TFJob\\nmetadata:\\n  name: {{.Trial}}\\n  namespace: {{.NameSpace}}\\nspec:\\n tfReplicaSpecs:\\n  Worker:\\n    replicas: 1\\n    restartPolicy: OnFailure\\n    template:\\n      spec:\\n        containers:\\n          - name: tensorflow\\n            image: gcr.io/gsoc-kf-example/tf_2_text_classification:1.4\\n            imagePullPolicy: Always\\n            command:\\n              - \"python3\"\\n              - \"/app/text_classification_rnn.py\"\\n              {{- with .HyperParameters}}\\n              {{- range .}}\\n              - \"{{.Name}}={{.Value}}\"\\n              {{- end}}\\n              {{- end}}'}}},\n",
       " 'status': {'conditions': [{'lastTransitionTime': '2020-07-26T17:22:44Z',\n",
       "    'lastUpdateTime': '2020-07-26T17:22:44Z',\n",
       "    'message': 'Experiment is created',\n",
       "    'reason': 'ExperimentCreated',\n",
       "    'status': 'True',\n",
       "    'type': 'Created'},\n",
       "   {'lastTransitionTime': '2020-07-26T17:22:59Z',\n",
       "    'lastUpdateTime': '2020-07-26T17:22:59Z',\n",
       "    'message': 'Experiment is running',\n",
       "    'reason': 'ExperimentRunning',\n",
       "    'status': 'True',\n",
       "    'type': 'Running'}],\n",
       "  'currentOptimalTrial': {'bestTrialName': '',\n",
       "   'observation': {'metrics': None},\n",
       "   'parameterAssignments': None},\n",
       "  'pendingTrialList': ['neural-machine-translation-8pb8z7fc',\n",
       "   'neural-machine-translation-dqb64l9j',\n",
       "   'neural-machine-translation-flkvp4nl',\n",
       "   'neural-machine-translation-rj46w9wn'],\n",
       "  'startTime': '2020-07-26T17:22:44Z',\n",
       "  'trials': 4,\n",
       "  'trialsPending': 4}}"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "kclient.delete_experiment(name=\"neural-machine-translation\", namespace=namespace)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
